package com.adteam.xmap.web;

import java.util.List;

import com.adteam.xmap.entity.Academy;
import com.adteam.xmap.manager.AcademyManager;
import com.opensymphony.xwork2.ActionSupport;

public class AcademyAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	
	private AcademyManager academyManager;
	
	private Academy academy;
	
	private List academys;
	
	private Integer id;

	@Override
	public String execute() throws Exception {
		academys = academyManager.findAllAcademys();
		return "SUCCESS";
	}
	
	public String addInput() {
		
		return "add_input";
	}
	
	public String add() {
		
		academyManager.addAcademy(academy);
		return "add_success";
	}
	
	public String del() {
		
		academyManager.delAcademy(id);
		return "del_success";
	}
	
	public String updateInput() {
		
		return "update_input";
	}
	
	public String update() {
		
		academyManager.updateAcademy(academy);
		return "update_success";
	}
	
	public String find() {
		
		academy = academyManager.findAcademyById(id);
		return "find_success";
	}

	public AcademyManager getAcademyManager() {
		return academyManager;
	}

	public void setAcademyManager(AcademyManager academyManager) {
		this.academyManager = academyManager;
	}

	public Academy getAcademy() {
		return academy;
	}

	public void setAcademy(Academy academy) {
		this.academy = academy;
	}

	public List getAcademys() {
		return academys;
	}

	public void setAcademys(List academys) {
		this.academys = academys;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	
}
